home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat2 / standard / shm_open.z / shm_open
Encoding:
Text File  |  1998-10-20  |  15.0 KB  |  265 lines

  1.  
  2.  
  3.  
  4. sssshhhhmmmm____ooooppppeeeennnn((((2222))))                                                        sssshhhhmmmm____ooooppppeeeennnn((((2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn - establishes a connection between a shared memory object and a
  10.      file descriptor
  11.  
  12. CCCC SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_mmmm_aaaa_nnnn_...._hhhh_>>>>
  14.  
  15.      _iiii_nnnn_tttt _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_p_a_t_h_,,,, _iiii_nnnn_tttt _o_f_l_a_g_,,,, _mmmm_oooo_dddd_eeee______tttt _m_o_d_e _))));
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _p_a_t_h is a pointer to the character string which names a shared memory
  19.      object.  _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn opens a file descriptor for the shared memory object
  20.      and sets the memory access flag according to the value of _o_f_l_a_g. The
  21.      _o_f_l_a_g must be set to one of the following values:
  22.  
  23.      _OOOO______RRRR_DDDD_OOOO_NNNN_LLLL_YYYY
  24.              Open the memory object for reading only.
  25.  
  26.      _OOOO______RRRR_DDDD_WWWW_RRRR  Open the memory object for reading and writing.
  27.  
  28.      With one of the above flags set, any of the following flags may also be
  29.      specified:
  30.  
  31.      _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT
  32.           If the memory object already exists, this flag has no effect, except
  33.           as noted under _OOOO______EEEE_XXXX_CCCC_LLLL below. Otherwise, the memory object is
  34.           created. Shared memory objects are represented by files in the file
  35.           namespace (commands like _llll_ssss will display memory objects as regular
  36.           files).  Because of this relationship, shared memory objects inherit
  37.           their access semantics from files.  The owner ID of the memory
  38.           object is set to the effective user IDs of the process, the group ID
  39.           of the memory object is set to the effective group IDs of the
  40.           process or to the group ID of the directory in which the memory
  41.           object is being created. This is determined as follows:
  42.  
  43.                If the underlying filesystem was mounted with the BSD file
  44.                creation semantics flag [see _ffff_ssss_tttt_aaaa_bbbb(4)] or the _SSSS______IIII_SSSS_GGGG_IIII_DDDD bit is
  45.                set [see _cccc_hhhh_mmmm_oooo_dddd(2)] on the parent directory, then the group ID
  46.                of the new file is set to the group ID of the parent directory,
  47.                otherwise it is set to the effective group ID of the calling
  48.                process.
  49.  
  50.                If the group ID of the memory object does not match the
  51.                effective group ID, or one of the supplementary groups IDs, the
  52.                _SSSS______IIII_SSSS_GGGG_IIII_DDDD bit is cleared.  The access permission bits of the file
  53.                mode are set to the value of _m_o_d_e, modified as follows:
  54.  
  55.                     All bits set in the file mode creation mask of the process
  56.                     are cleared [see _uuuu_mmmm_aaaa_ssss_kkkk(2)].
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. sssshhhhmmmm____ooooppppeeeennnn((((2222))))                                                        sssshhhhmmmm____ooooppppeeeennnn((((2222))))
  71.  
  72.  
  73.  
  74.                     The ``save text image after execution bit'' of the mode is
  75.                     cleared [see _cccc_hhhh_mmmm_oooo_dddd(2)].
  76.  
  77.      _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC If the shared memory object exists, its length is truncated to
  78.              zero and the mode and owner are unchanged.
  79.  
  80.      _OOOO______EEEE_XXXX_CCCC_LLLL  If _OOOO______EEEE_XXXX_CCCC_LLLL and _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT are set, _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn will fail if the memory
  81.              object exists. The check for the existence of the memory object
  82.              and the creation of the name in the file namespace is atomic with
  83.              respect to other processes executing _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn naming the same
  84.              memory object in the same directory with _OOOO______EEEE_XXXX_CCCC_LLLL and _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT set.
  85.  
  86.      Shared memory objects and their associated data persist until the memory
  87.      object is unlinked and all other references are dropped [see
  88.      _ssss_hhhh_mmmm______uuuu_nnnn_llll_iiii_nnnn_kkkk(2) and _cccc_llll_oooo_ssss_eeee(2)].
  89.  
  90.      If _p_a_t_h is a symbolic link and _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT and _OOOO______EEEE_XXXX_CCCC_LLLL are set, the link is
  91.      not followed.
  92.  
  93.      The new shared memory object file descriptor is the lowest numbered file
  94.      descriptor available and is set to close upon the execution of an _eeee_xxxx_eeee_cccc
  95.      system call.
  96.  
  97.      The _FFFF_DDDD______CCCC_LLLL_OOOO_EEEE_XXXX_EEEE_CCCC file descriptor flag of the newly created shared memory
  98.      object is set.  This flag will cause the file descriptor to close upon
  99.      the execution of an _eeee_xxxx_eeee_cccc system call.
  100.  
  101.      Memory object file descriptor flag values may be modified following
  102.      _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn as described in _ffff_cccc_nnnn_tttt_llll(2).
  103.  
  104.      If _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is set and the memory object did not previously exist,
  105.      _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn marks the following memory object fields for update: _ssss_tttt______aaaa_tttt_iiii_mmmm_eeee,
  106.      _ssss_tttt______cccc_tttt_iiii_mmmm_eeee and _ssss_tttt______mmmm_tttt_iiii_mmmm_eeee. Further, the _ssss_tttt______tttt_iiii_mmmm_eeee and _ssss_tttt______mmmm_tttt_iiii_mmmm_eeee fields of the
  107.      memory object parent directory are also marked for update.
  108.  
  109.      If _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is set and the memory object did previously exist, _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn
  110.      marks the _ssss_tttt______cccc_tttt_iiii_mmmm_eeee and _ssss_tttt______mmmm_tttt_iiii_mmmm_eeee fields for update.
  111.  
  112.      There is a system enforced limit on the number of open file descriptors
  113.      per process _{{{{_OOOO_PPPP_EEEE_NNNN______MMMM_AAAA_XXXX_}}}}, whose value is returned by the _gggg_eeee_tttt_dddd_tttt_aaaa_bbbb_llll_eeee_ssss_iiii_zzzz_eeee(2)
  114.      function.
  115.  
  116.      If the character string, pointed to by _p_a_t_h, is prefixed with _////_dddd_eeee_vvvv then
  117.      unpredictable results may occur.  Devices are opened using the _oooo_pppp_eeee_nnnn(2)
  118.      function.
  119.  
  120.      The shared memory object is opened unless one or more of the following
  121.      are true:
  122.  
  123.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS  The shared memory object, named by _p_a_t_h, does not exist and write
  124.              permission is denied by the parent directory of the memory object
  125.              to be created.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. sssshhhhmmmm____ooooppppeeeennnn((((2222))))                                                        sssshhhhmmmm____ooooppppeeeennnn((((2222))))
  137.  
  138.  
  139.  
  140.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT or _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is specified and write permission is denied.
  141.  
  142.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS  A component of the path prefix denies search permission.
  143.  
  144.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS  _o_f_l_a_g permission is denied for an existing memory object.
  145.  
  146.      _EEEE_AAAA_GGGG_AAAA_IIII_NNNN  The shared memory object exists, _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT or _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC are
  147.              specified, mandatory file/record locking is set, and there are
  148.              outstanding record locks on the file naming the object [see
  149.              _cccc_hhhh_mmmm_oooo_dddd(2)].
  150.  
  151.      _EEEE_DDDD_QQQQ_UUUU_OOOO_TTTT  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is specified, the memory object does not exist, and the
  152.              directory in which the entry for the new memory object is being
  153.              placed cannot be extended either because the user's quota of disk
  154.              blocks on the file system containing the directory has been
  155.              exhausted or the user's quota of inodes on the file system on
  156.              which the file is being created has been exhausted.
  157.  
  158.      _EEEE_EEEE_XXXX_IIII_SSSS_TTTT  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT and _OOOO______EEEE_XXXX_CCCC_LLLL are set, and the shared memory object exists.
  159.  
  160.      _EEEE_FFFF_AAAA_UUUU_LLLL_TTTT  _p_a_t_h points outside the allocated address space of the process.
  161.  
  162.      _EEEE_IIII_NNNN_TTTT_RRRR   A signal was caught during the _ssss_hhhh_mmmm______oooo_pppp_eeee_nnnn system call.
  163.  
  164.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL  _p_a_t_h The _FFFF_DDDD______CCCC_LLLL_OOOO_EEEE_XXXX_EEEE_CCCC file descriptor flag of the named shared
  165.              memory object could not be set.
  166.  
  167.      _EEEE_IIII_SSSS_DDDD_IIII_RRRR  The memory object is a directory and _o_f_l_a_g is write or
  168.              read/write.
  169.  
  170.      _EEEE_LLLL_OOOO_OOOO_PPPP   Too many symbolic links were encountered in translating _p_a_t_h.
  171.  
  172.      _EEEE_MMMM_FFFF_IIII_LLLL_EEEE  The process has too many open files [see _gggg_eeee_tttt_rrrr_llll_iiii_mmmm_iiii_tttt(2)].
  173.  
  174.      _EEEE_NNNN_AAAA_MMMM_EEEE_TTTT_OOOO_OOOO_LLLL_OOOO_NNNN_GGGG
  175.              The length of the _p_a_t_h argument exceeds {_PPPP_AAAA_TTTT_HHHH______MMMM_AAAA_XXXX}, or the length
  176.              of a _p_a_t_h component exceeds {_NNNN_AAAA_MMMM_EEEE______MMMM_AAAA_XXXX} while {______PPPP_OOOO_SSSS_IIII_XXXX______NNNN_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC} is
  177.              in effect.
  178.  
  179.      _EEEE_NNNN_FFFF_IIII_LLLL_EEEE  The system file table is full.
  180.  
  181.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is not set and the shared memory object does not exist.
  182.  
  183.      _EEEE_NNNN_OOOO_EEEE_NNNN_TTTT  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is set and a component of the path prefix does not exist
  184.              or is the null pathname.
  185.  
  186.      _EEEE_NNNN_OOOO_SSSS_PPPP_CCCC  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT and _OOOO______EEEE_XXXX_CCCC_LLLL are set, and the file system is out of inodes
  187.              or the directory in which the entry for the new memory object is
  188.              being placed cannot be extended because there is no space left on
  189.              the file system containing the directory.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. sssshhhhmmmm____ooooppppeeeennnn((((2222))))                                                        sssshhhhmmmm____ooooppppeeeennnn((((2222))))
  203.  
  204.  
  205.  
  206.      _EEEE_NNNN_OOOO_SSSS_PPPP_CCCC  _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT is set and the directory that would contain the memory
  207.              object cannot be extended.
  208.  
  209.      _EEEE_NNNN_OOOO_TTTT_DDDD_IIII_RRRR A component of the path prefix is not a directory.
  210.  
  211.      _EEEE_TTTT_IIII_MMMM_EEEE_DDDD_OOOO_UUUU_TTTT
  212.              The memory object of the shm_open is located on a remote system
  213.              which is not available [see _iiii_nnnn_tttt_rrrr_oooo(2)].
  214.  
  215.      _EEEE_RRRR_OOOO_FFFF_SSSS   The named memory object resides on a read-only file system and
  216.              either _OOOO______WWWW_RRRR_OOOO_NNNN_LLLL_YYYY, _OOOO______RRRR_DDDD_WWWW_RRRR, _OOOO______CCCC_RRRR_EEEE_AAAA_TTTT, or _OOOO______TTTT_RRRR_UUUU_NNNN_CCCC is set in _o_f_l_a_g (if
  217.              the memory object does not exist).
  218.  
  219. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  220.      _cccc_llll_oooo_ssss_eeee(2), _dddd_uuuu_pppp(2), _eeee_xxxx_eeee_cccc(2), _ffff_cccc_nnnn_tttt_llll(2), _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee(2), _mmmm_mmmm_aaaa_pppp(2),
  221.      _ssss_hhhh_mmmm______uuuu_nnnn_llll_iiii_nnnn_kkkk(2), _uuuu_mmmm_aaaa_ssss_kkkk(2)
  222.  
  223. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  224.      Upon successful completion, the file descriptor is returned.  Otherwise,
  225.      a value of -1 is returned and _eeee_rrrr_rrrr_nnnn_oooo is set to indicate the error.
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.